package cn.agiledata.bank.linkbank.impl.icbc;

import cn.agiledata.bank.common.util.StringUtil;
import cn.agiledata.bank.linkbank.logic.CryptoKeyValidator;

/**
 * 中国工商银行密钥校验器
 * 
 * @author maxianbo
 * 
 */
public final class IcbcCryptoKeyValidator implements CryptoKeyValidator {

    public String getCryptoKeyDescription() {
        return "constant.bank.net.mac_key_rule.icbc";
    }

    public boolean validateCryptoKey(String cryptoKey) {
        if (cryptoKey == null)
            return false;
        String pattern = "[0-9]{8}";
        return StringUtil.matchRegex(cryptoKey, pattern);
    }

}
